package com.logger;

import com.logger.handlers.AHandler;

import java.util.LinkedList;
import java.util.List;

/**
 * 存储一个打印日志中的多个处理实现
 * Created by chenxunlin01 on 2016/1/16.
 */

public class LoggerPocket {

    private List<AHandler> handlers;
    private LogMessage message;

    public LoggerPocket(LogMessage message) {
        this.message = message;
        handlers = new LinkedList<>();
    }

    public List<AHandler> getHandlers() {
        return handlers;
    }

    public void addHandler(AHandler handler) {
        handlers.add(handler);
    }

    public LogMessage getMessage() {
        return message;
    }

    public void setMessage(LogMessage message) {
        this.message = message;
    }

    /**
     * 是否有处理方式
     * @return
     */
    public boolean isEmpty(){
        return handlers.isEmpty();
    }
}
